﻿using UnityEngine;
using System.Collections;

public class Player : MonoBehaviour 
{
	
	public CharacterController characterController;
	public float velocity = 15.0f;
	

	void Awake()
	{
		
	}
	
	void Start () 
	{
	  
	}
	
	
	void Update ()
	{
		if(Input.GetKey(KeyCode.RightArrow)||Input.GetKey(KeyCode.D))
		{
			characterController.Move(new Vector3(velocity,0,0)*Time.deltaTime);
		}
		
		else if(Input.GetKey(KeyCode.LeftArrow)||Input.GetKey(KeyCode.A))
		{
			characterController.Move(new Vector3(-velocity,0,0)*Time.deltaTime);
		}
		
		if(Input.GetKey(KeyCode.UpArrow)||Input.GetKey(KeyCode.W))
		{
			characterController.Move(new Vector3(0,velocity,0)*Time.deltaTime);
		}
		
		else if(Input.GetKey(KeyCode.DownArrow)||Input.GetKey(KeyCode.S))
		{
			characterController.Move(new Vector3(0,-velocity,0)*Time.deltaTime);
		}
		
				
	}
	
	
}
